﻿using Adp;
using Adp.Core.Attribute;
using Yqd.Enm;
using System;
using System.Collections.Generic;
using System.Text;

namespace Yqd
{
    public class Config
    {
        public static string PostDomain = "";
        public static string Api(string api)
        {
            var url = PostDomain.Combine(api);
            return url;
        }

        public static string Domain(string path = "")
        {
            return Adp.Env.GetSiteDomain("Yqd", path);
        }

        public static (string AppKey, string AppSecret, int TenantId) AppSecret(AccessTokenMode mode)
        {
            var v = Adp.Env.Config.Init("Yqd", "浙政钉配置", "AppID", mode.ToString()).First();
            PostDomain = v.Value3;
            return (v.Value, v.Value1, v.Value2.ToInt());
        }
        public static string Yqdpath(string path = "")
        {
            return Adp.Env.ServerRoot.Combine("wwwroot/client/yqd", path);
        }
        public static string YqdRoot()
        {
            return "/Client/yqd";
        }

    
    }
}
